package com.fm.service;

/**
 * Created by Administrator on 2018/7/30 0030.
 */


import com.fm.entity.RuleSql;
import com.fm.mapper.RuleSqlMapper;
import org.springframework.data.domain.Example;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RuleSqlService extends MBaseService<RuleSql, Integer, RuleSqlMapper>{

    public void deleteByRule(Integer ruleId) {
        RuleSql sql = new RuleSql();
        sql.setRuleId(ruleId);
        List<RuleSql> ruleSqls = getMyBatisDao().findAll(Example.of(sql));
        for (RuleSql ruleSql : ruleSqls) {
            getMyBatisDao().delete(ruleSql);
        }
    }

}
